package com.ymatou.app.rec.service;

import org.json.JSONObject;

import com.ymt.base.YmatouBaseCall;
import com.ymttest.utils.EnvSetup;

/**
 * 关键词搜索接口Call FreeMaker Template自动生成代码
 */
public class JyhCall extends YmatouBaseCall {
	private static String opurl = "search/jyh";

	public JyhCall() {
		super(EnvSetup.getSystemUrl("jyhInterest"), opurl, "GET", "PARAM");
	}

	@Override
	public void addDefHeader() {
		client.addHeader("Accept",
				"text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}

	// 获取status
	public String getStatus() {
		String status = null;
		try {
			JSONObject jo = new JSONObject(getReturnData());
			status = jo.getString("status");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return status;
	}
}